-- GENERATED SPELL FOR [Atal'ai High Priest] --


function spell0_5273(pUnit, Event) --@Heal,Heal--
pUnit:FullCastSpellOnTarget(12039,pUnit)
pUnit:RegisterEvent('Sorts_5273', 3000, 1)
end

function spell1_5273(pUnit, Event) --@Renew,Heal--
pUnit:FullCastSpellOnTarget(8362,pUnit)
pUnit:RegisterEvent('Sorts_5273', 22000, 1)
end

function spell2_5273(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(9613,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_5273', 3000, 1)
end

function spell3_5273(pUnit, Event) --@Shadow Shield,n/a--
pUnit:FullCastSpellOnTarget(12040,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_5273', 30292, 1)
end

function spell4_5273(pUnit, Event) --@Summon Atal\'ai Skeleton,n/a--
pUnit:FullCastSpellOnTarget(12151,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_5273', 1000, 1)
end

function Sorts_5273(pUnit, Event)
local choix_sorts_5273 = math.random(0, 4)
if choix_sorts_5273 == 0 then
pUnit:RegisterEvent('spell0_5273', 1, 1)
end
if choix_sorts_5273 == 1 then
pUnit:RegisterEvent('spell1_5273', 1, 1)
end
if choix_sorts_5273 == 2 then
pUnit:RegisterEvent('spell2_5273', 1, 1)
end
if choix_sorts_5273 == 3 then
pUnit:RegisterEvent('spell3_5273', 1, 1)
end
if choix_sorts_5273 == 4 then
pUnit:RegisterEvent('spell4_5273', 1, 1)
end
end

function mob5273_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_5273', math.random(1500, 3000), 1)
end

function mob5273_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob5273_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob5273_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(5273, 1, 'mob5273_Action')
RegisterUnitEvent(5273, 2, 'mob5273_Leave')
RegisterUnitEvent(5273, 3, 'mob5273_Kill')
RegisterUnitEvent(5273, 4, 'mob5273_Die')
